<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script language="Javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.tablesorter.js"></script>
<script type="text/javascript" src="js/paging.js"></script>

<script language="JavaScript">
	$(document).ready(function() {
		$("#allsts").change(function() {
			var isChecked = $('.selsts').attr('checked') ? true : false;
			if (isChecked == false) {
				$(".selsts").attr('checked', true);
			} else {
				$(".selsts").attr('checked', false);
			}

		});

		$('#search').keyup(function() {
			searchTable($(this).val());
		});

		$("#example").tablesorter({
			// pass the headers argument and assing a object 
			headers : {
				// assign the secound column (we start counting zero) 
				8 : {
					// disable it by setting the property sorter to false 
					sorter : false
				}
			}
		});
	});

	function searchTable(inputVal) {
		var table = $('#example');
		table.find('tr').each(function(index, row) {
			var allCells = $(row).find('td');
			if (allCells.length > 0) {
				var found = false;
				allCells.each(function(index, td) {
					var regExp = new RegExp(inputVal, 'i');
					if (regExp.test($(td).text())) {
						found = true;
						return false;
					}
				});
				if (found == true)
					$(row).show();
				else
					$(row).hide();
			}
		});
	}
</script>

<link rel="stylesheet" type="text/css" href="css/style.css">

</head>
<body>
	<s:actionerror />
	<form method="post" action="editedsemwisefee.action">
<input type="hidden" name="student_id" value='<s:property value="student_id"/>'/>

		<table id="example" class="tablesorter">

			<s:iterator value="list">
				<tr>
					<th>Semester</th>
					<td><s:property value="year_semester_id" /><input type="hidden" name="year_semester_id" value='<s:property value="year_semester_id"/>'/></td>
				</tr>
				<tr>
					<th>Description</th>
					<td><s:property value="description" /></td>
				</tr>
				<tr>
					<th>Hostel Fees</th>
					<td><s:property value="hostel_fee" /></td>
				</tr>
				<tr>
					<th>Mess fees</th>
					<td><s:property value="mess_fee" /></td>
				</tr>
				<tr>
					<th>Other fees</th>
					<td><s:property value="other_fee" /></td>
				</tr>
				<tr>
					<th>Tution fee</th>
					<td><s:property value="tuition_fee" /></td>
				</tr>
				<tr>
					<th>Library fee</th>
					<td><s:property value="library_fee" /></td>
				</tr>
				<tr>
					<th>Total fee</th>
					<td><s:property value="total_payment" /></td>
				</tr>
			<tr>
				<th>Paid Amount</th>
				<td><s:property value="amt_paid" /> --> in transactions : <s:property value="t_id"/></td>
			</tr>
			<tr>
				<th>Add Transaction</th>
				<td><input type="text" name="amt_paid"/></td>
			</tr>
			<tr>
				<th>Transaction Id</th>
				<td><input type="text" name="t_id"/></td>
			</tr>
				<tr>
					<td><input type="submit" value="Add Transaction" /></td>
				</tr>
			</s:iterator>
		</table>
	</form>
</body>
</html>